<%--
  Created by IntelliJ IDEA.
  User: a
  Date: 2025/8/28
  Time: 16:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {

            //1.
            $.get("projectInfo/queryByPid","pid="+$("[name='pid']").val(),function (pro) {
                $("td:eq(1)").text(pro.pid);
                $("td:eq(3)").text(pro.pname);
                $("td:eq(5)").text(pro.startdate);
                $("td:eq(7)").text(pro.enddate);
            });

           //2.点击 审核 发送异步请求，获得审核结果：
            $("[value='审核']").click(function () {

                var pid=$("[name='pid']").val();
                var status=$("select").val();

                $.get("projectInfo/updatePro",{"pid":pid,"status":status},function (dt) {

                    JSON.stringify(dt);
                    alert(dt?"审核成功！":"审核失败！");
                    window.location.href="ajaxindex.jsp";
                });
            });
        });
    </script>
</head>
<body>


<input type="hidden" name="pid" value="<%=request.getParameter("pid")%>">
<table>
    <caption>申报项目信息</caption>
    <tr>
        <td>项目编号</td>
        <td></td>
    </tr>
    <tr>
        <td>项目名称</td>
        <td></td>
    </tr>
    <tr>
        <td>项目开始时间</td>
        <td></td>
    </tr>
    <tr>
        <td>项目结束时间</td>
        <td></td>
    </tr>
    <tr>
        <td>项目状态</td>
        <td>
            <select name="status">
                <option value="1">审核中</option>
                <option value="2">已审核</option>
            </select>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="button" value="审核"/>
            <input type="button" value="返回" />
        </td>
    </tr>
</table>




</body>
</html>
